package string;

import com.sun.org.apache.xpath.internal.operations.Equals;

public class StringDemo {
    public static void main(String[] args) {

        String s2 = new String();
        s2 = "hello";



        String s = new String("hello");
        String s1 = "hello";
        System.out.println(s == s1);
        System.out.println(s2 == s1);


        System.out.println(s.equals(s1));




        /*String a = "abc123";
        String b = "abc"+"123";
        String c = "abc";
        String d = c+"123";
        System.out.println(a == b);
        System.out.println(a == d);*/

       /* String a = "hello";
        String b = "hello";
        String c = "hello";

        System.out.println(a == b);
        System.out.println(a == c);
        System.out.println(b == c);

        a = a + "!";

        System.out.println(a == b);*/

    }
}
